package com.kiln.juxingqs.ui.vm

import android.app.Application
import androidx.lifecycle.MutableLiveData
import client.global.commlib.network.data.JsonResult
import com.kiln.juxingqs.api.bean.GoodsIndex
import com.kiln.juxingqs.ui.viewmodel.MiddleVm

class SearchRetModel(app: Application) : MiddleVm(app) {

    val wordVal = MutableLiveData<String>("")
    val isOneLoading = MutableLiveData<Boolean>(false)
    val searchType = MutableLiveData<String>("商品")
    val currMode = MutableLiveData<Int>(0)
    val sortMode = MutableLiveData<Int>(0)
    val page = MutableLiveData<Int>(0)
    val ret = MutableLiveData<JsonResult<GoodsIndex>>()

    fun getData() {
        hold({
            server.goods_index(wordVal.value!!)
        }, {
        }, {
            ret.value = it
        })
    }

}